const { Controller } = require('egg');

class HomeController extends Controller {
  async index() {
    const { ctx } = this;
    ctx.body = 'hi, egg';
  }
  async getXCsrfToken() {
    const { ctx } = this;
    ctx.body = {
      code: this.config.code.SUCCESS,
      msg: '获取成功，请从 cookie 中截取 x-csrf-token'
    };
  }
}

module.exports = HomeController;
